import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Dialogue from '@/views/Dialogue.vue'
import Conversation from '@/views/Conversation.vue'
import Chart from '@/views/Chart.vue'
import Qianwen from '@/views/Qianwen.vue'
import Naming from '@/views/Naming.vue'
import Goods from '@/views/Goods.vue'
import ProductDetail from '@/views/ProductDetail.vue'
import Index from '@/views/Index.vue'

const routes = [
  {
    path: '/index',
    name: 'index',
    component: Index
  },
  {
    path: '/productDetail/:id/',
    name: 'productDetail',
    component: ProductDetail
  },
  {
    path: '/goods',
    name: 'goods',
    component: Goods
  },
  {
    path: '/name',
    name: 'name',
    component: Naming
  },
  {
    path: '/qwen',
    name: 'qwen',
    component: Qianwen
  },
  {
    path: '/chart',
    name: 'chart',
    component: Chart
  },
  {
    path: '/conversation',
    name: 'conversation',
    component: Conversation
  },
  {
    path: '/dialogue',
    name: 'dialogue',
    component: Dialogue
  },
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
